package com.cscp.javastudy.juc.functionalprogramming.functioninterface;

import java.util.function.Supplier;

/**
 * 供应型接口：没有输入只有返回
 */
public class SupplierInterfaceDemo1 {

    public static void main(String[] args) {

//        Supplier<String> supplier = new Supplier<String>() {
//            @Override
//            public String get() {
//                System.out.println("get()");
//                return "hello";
//            }
//        };

        Supplier<String> supplier = ()->{
            return "hello";
        };
        System.out.println(supplier.get());
    }
}
